import random

# 定义车辆类型列表、品牌列表、车系列表、颜色列表
vehicle_type_list = ['轿车', 'SUV', 'MPV', '跑车', '卡车']
brand_list = ['奥迪', '宝马', '奔驰', '大众', '丰田']
series_list = ['A6', 'X5', 'E级', '帕萨特', '凯美瑞']
color_list = ['白色', '黑色', '红色', '蓝色', '银色']

# 生成10000辆车的车牌号码
license_plate_list = []
for i in range(450000):
    license_plate = random.choice(['川A', '鄂B', '湘D', '皖C', '京N']) + str(random.randint(10000, 99999))
    license_plate_list.append(license_plate)

# 生成车辆维度表
data_list = []
for license_plate in license_plate_list:
    vehicle_type = random.choice(vehicle_type_list)
    brand = random.choice(brand_list)
    series = random.choice(series_list)
    color = random.choice(color_list)
    data_list.append((license_plate, vehicle_type, brand, series, color))

# 将车辆维度表写入CSV文件
with open("vehicles.csv", mode="w", encoding="utf-8") as file:
    for data in data_list:
        file.write("{},{},{},{},{}\n".format(data[0], data[1], data[2], data[3], data[4]))
